Skip to content

perf: optimize token index lookup in enforcer#1700

Open
AKonnyaku wants to merge 1 commit intoapache:masterfrom
AKonnyaku:enforcer-test
Open

perf: optimize token index lookup in enforcer#1700
AKonnyaku wants to merge 1 commit intoapache:masterfrom
AKonnyaku:enforcer-test

Conversation

@AKonnyaku
Copy link
Contributor

This PR optimizes the Casbin enforcer's performance by caching token index mappings, reducing redundant computations during policy enforcement.

  • Pre-computation: Implemented TokenIndexMap within the Assertion struct to cache token indices upon model loading, avoiding repetitive loop lookups.
  • Direct Access: Updated enforce logic and management APIs to utilize the cached map instead of reconstructing it for every request.
  • Model Initialization: Modified model.go to populate the index map during the parsing of r , p , and g definitions.
  • Deep Copy Support: Enhanced the Assertion.copy method to ensure thread-safe deep copying of the new index map.
  • Verification: Added unit tests to validate map initialization correctness and deep copy integrity.

This optimization significantly lowers the overhead for high-throughput policy checks.

@github-actions
Copy link

Benchmark Comparison

Comparing base branch (0fe9505)
vs PR branch (4bbaaa6)

goos: linux
goarch: amd64
pkg: github.com/casbin/casbin/v3
cpu: AMD EPYC 7763 64-Core Processor                
                                                 │ base-bench.txt │             pr-bench.txt              │
                                                 │     sec/op     │    sec/op      vs base                     Diff          │
CachedRaw                                          15.37n ± ∞ ¹    15.26n ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.72% ➡️
CachedBasicModel                                   176.6n ± ∞ ¹    168.9n ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.36% ➡️
CachedRBACModel                                    180.1n ± ∞ ¹    168.9n ± ∞ ¹       ~ (p=1.000 n=1) ²        -6.22% ➡️
CachedRBACModelSmall                               183.4n ± ∞ ¹    175.4n ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.36% ➡️
CachedRBACModelMedium                              182.3n ± ∞ ¹    186.0n ± ∞ ¹       ~ (p=1.000 n=1) ²        +2.03% ➡️
CachedRBACModelLarge                               163.0n ± ∞ ¹    153.2n ± ∞ ¹       ~ (p=1.000 n=1) ²        -6.01% ➡️
CachedRBACModelWithResourceRoles                   174.7n ± ∞ ¹    169.2n ± ∞ ¹       ~ (p=1.000 n=1) ²        -3.15% ➡️
CachedRBACModelWithDomains                         179.9n ± ∞ ¹    177.1n ± ∞ ¹       ~ (p=1.000 n=1) ²        -1.56% ➡️
CachedABACModel                                    2.703µ ± ∞ ¹    2.342µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -13.36% 🚀
CachedKeyMatchModel                                194.5n ± ∞ ¹    186.8n ± ∞ ¹       ~ (p=1.000 n=1) ²        -3.96% ➡️
CachedRBACModelWithDeny                            175.3n ± ∞ ¹    168.3n ± ∞ ¹       ~ (p=1.000 n=1) ²        -3.99% ➡️
CachedPriorityModel                                176.6n ± ∞ ¹    168.4n ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.64% ➡️
CachedWithEnforceContext                           246.4n ± ∞ ¹    233.4n ± ∞ ¹       ~ (p=1.000 n=1) ²        -5.28% ➡️
CachedRBACModelMediumParallel                      165.9n ± ∞ ¹    165.3n ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.36% ➡️
HasPolicySmall                                     436.3n ± ∞ ¹    437.6n ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.30% ➡️
HasPolicyMedium                                    450.2n ± ∞ ¹    447.7n ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.56% ➡️
HasPolicyLarge                                     482.5n ± ∞ ¹    478.2n ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.89% ➡️
AddPolicySmall                                     536.8n ± ∞ ¹    538.3n ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.28% ➡️
AddPolicyMedium                                    642.4n ± ∞ ¹    614.8n ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.30% ➡️
AddPolicyLarge                                     1.153µ ± ∞ ¹    1.241µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +7.63% ➡️
RemovePolicySmall                                  512.8n ± ∞ ¹    514.2n ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.27% ➡️
RemovePolicyMedium                                 544.3n ± ∞ ¹    556.1n ± ∞ ¹       ~ (p=1.000 n=1) ²        +2.17% ➡️
RemovePolicyLarge                                  588.5n ± ∞ ¹    587.9n ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.10% ➡️
Raw                                                15.08n ± ∞ ¹    15.00n ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.53% ➡️
BasicModel                                         3.609µ ± ∞ ¹    3.266µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -9.50% ➡️
RBACModel                                          5.336µ ± ∞ ¹    5.109µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.25% ➡️
RBACModelSizes/small                               48.22µ ± ∞ ¹    50.52µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +4.77% ➡️
RBACModelSizes/medium                              473.5µ ± ∞ ¹    510.7µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +7.86% ➡️
RBACModelSizes/large                               5.346m ± ∞ ¹    5.521m ± ∞ ¹       ~ (p=1.000 n=1) ²        +3.27% ➡️
RBACModelSmall                                     55.89µ ± ∞ ¹    60.58µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +8.39% ➡️
RBACModelMedium                                    544.5µ ± ∞ ¹    594.0µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +9.09% ➡️
RBACModelLarge                                     5.744m ± ∞ ¹    5.981m ± ∞ ¹       ~ (p=1.000 n=1) ²        +4.13% ➡️
RBACModelWithResourceRoles                         4.376µ ± ∞ ¹    4.117µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -5.92% ➡️
RBACModelWithDomains                               4.915µ ± ∞ ¹    4.730µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -3.76% ➡️
ABACModel                                          2.650µ ± ∞ ¹    2.307µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -12.94% 🚀
ABACRuleModel                                      3.917m ± ∞ ¹    4.073m ± ∞ ¹       ~ (p=1.000 n=1) ²        +3.98% ➡️
KeyMatchModel                                      5.859µ ± ∞ ¹    5.681µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -3.04% ➡️
RBACModelWithDeny                                  6.710µ ± ∞ ¹    6.696µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.21% ➡️
PriorityModel                                      4.002µ ± ∞ ¹    3.786µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -5.40% ➡️
RBACModelWithDomainPatternLarge                    12.36µ ± ∞ ¹    12.69µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +2.67% ➡️
RoleManagerSmall                                   47.95µ ± ∞ ¹    47.51µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.92% ➡️
RoleManagerMedium                                  536.1µ ± ∞ ¹    531.6µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.84% ➡️
RoleManagerLarge                                   5.774m ± ∞ ¹    6.020m ± ∞ ¹       ~ (p=1.000 n=1) ²        +4.26% ➡️
BuildRoleLinksWithPatternLarge                     280.3m ± ∞ ¹    292.0m ± ∞ ¹       ~ (p=1.000 n=1) ²        +4.17% ➡️
BuildRoleLinksWithDomainPatternLarge               8.709m ± ∞ ¹    9.414m ± ∞ ¹       ~ (p=1.000 n=1) ²        +8.10% ➡️
BuildRoleLinksWithPatternAndDomainPatternLarge     287.0m ± ∞ ¹    302.9m ± ∞ ¹       ~ (p=1.000 n=1) ²        +5.54% ➡️
HasLinkWithPatternLarge                            983.0n ± ∞ ¹   1030.0n ± ∞ ¹       ~ (p=1.000 n=1) ²        +4.78% ➡️
HasLinkWithDomainPatternLarge                      340.0n ± ∞ ¹    341.8n ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.53% ➡️
HasLinkWithPatternAndDomainPatternLarge            981.2n ± ∞ ¹   1031.0n ± ∞ ¹       ~ (p=1.000 n=1) ²        +5.08% ➡️
ConcurrentHasLinkWithMatching                      1.155µ ± ∞ ¹    1.203µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +4.16% ➡️
geomean                                              4.912µ          4.888µ                                    -0.49% ➡️
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

                                                 │ base-bench.txt │             pr-bench.txt              │
                                                 │      B/op      │     B/op       vs base                     Diff          │
CachedRaw                                           0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedBasicModel                                    104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModel                                     104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelSmall                                104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelMedium                               104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelLarge                                96.00 ± ∞ ¹     96.00 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelWithResourceRoles                    104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelWithDomains                          120.0 ± ∞ ¹     120.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedABACModel                                   1.504Ki ± ∞ ¹   1.005Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -33.18% 🚀
CachedKeyMatchModel                                 152.0 ± ∞ ¹     152.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelWithDeny                             104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedPriorityModel                                 104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedWithEnforceContext                            176.0 ± ∞ ¹     176.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelMediumParallel                       104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
HasPolicySmall                                      102.0 ± ∞ ¹     102.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
HasPolicyMedium                                     109.0 ± ∞ ¹     109.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
HasPolicyLarge                                      117.0 ± ∞ ¹     117.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
AddPolicySmall                                      152.0 ± ∞ ¹     152.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
AddPolicyMedium                                     166.0 ± ∞ ¹     166.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
AddPolicyLarge                                      418.0 ± ∞ ¹     423.0 ± ∞ ¹       ~ (p=1.000 n=1) ³        +1.20% ➡️
RemovePolicySmall                                   166.0 ± ∞ ¹     166.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
RemovePolicyMedium                                  173.0 ± ∞ ¹     174.0 ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.58% ➡️
RemovePolicyLarge                                   181.0 ± ∞ ¹     181.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
Raw                                                 0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
BasicModel                                         1518.0 ± ∞ ¹    1004.0 ± ∞ ¹       ~ (p=1.000 n=1) ³        -33.86% 🚀
RBACModel                                         2.021Ki ± ∞ ¹   1.524Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -24.59% 🚀
RBACModelSizes/small                              19.79Ki ± ∞ ¹   19.33Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -2.32% ➡️
RBACModelSizes/medium                             186.8Ki ± ∞ ¹   186.7Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -0.05% ➡️
RBACModelSizes/large                              1.811Mi ± ∞ ¹   1.812Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.06% ➡️
RBACModelSmall                                    19.75Ki ± ∞ ¹   19.44Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -1.57% ➡️
RBACModelMedium                                   189.5Ki ± ∞ ¹   189.5Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.00% ➡️
RBACModelLarge                                    1.840Mi ± ∞ ¹   1.840Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.00% ➡️
RBACModelWithResourceRoles                        1.799Ki ± ∞ ¹   1.302Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -27.63% 🚀
RBACModelWithDomains                              1.792Ki ± ∞ ¹   1.293Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -27.85% 🚀
ABACModel                                          1536.0 ± ∞ ¹    1021.0 ± ∞ ¹       ~ (p=1.000 n=1) ³        -33.53% 🚀
ABACRuleModel                                     1.243Mi ± ∞ ¹   1.252Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.72% ➡️
KeyMatchModel                                     3.000Ki ± ∞ ¹   2.508Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -16.40% 🚀
RBACModelWithDeny                                 2.428Ki ± ∞ ¹   1.935Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -20.30% 🚀
PriorityModel                                     1.728Ki ± ∞ ¹   1.229Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -28.88% 🚀
RBACModelWithDomainPatternLarge                   8.681Ki ± ∞ ¹   8.185Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -5.71% ➡️
RoleManagerSmall                                    800.0 ± ∞ ¹     800.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
RoleManagerMedium                                 13.63Ki ± ∞ ¹   13.63Ki ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
RoleManagerLarge                                  224.6Ki ± ∞ ¹   224.6Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.00% ➡️
BuildRoleLinksWithPatternLarge                    60.78Mi ± ∞ ¹   60.84Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.10% ➡️
BuildRoleLinksWithDomainPatternLarge              3.940Mi ± ∞ ¹   3.951Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.28% ➡️
BuildRoleLinksWithPatternAndDomainPatternLarge    62.35Mi ± ∞ ¹   62.44Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.14% ➡️
HasLinkWithPatternLarge                             112.0 ± ∞ ¹     112.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
HasLinkWithDomainPatternLarge                       16.00 ± ∞ ¹     16.00 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
HasLinkWithPatternAndDomainPatternLarge             112.0 ± ∞ ¹     112.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
ConcurrentHasLinkWithMatching                       736.0 ± ∞ ¹     736.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
geomean                                                         ⁴                                              -5.77% ➡️               ⁴
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ need >= 4 samples to detect a difference at alpha level 0.05
⁴ summaries must be >0 to compute geomean

                                                 │ base-bench.txt │             pr-bench.txt             │
                                                 │   allocs/op    │  allocs/op    vs base                      Diff          │
CachedRaw                                           0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedBasicModel                                    4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModel                                     4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelSmall                                4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelMedium                               4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelLarge                                3.000 ± ∞ ¹    3.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelWithResourceRoles                    4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelWithDomains                          4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedABACModel                                     18.00 ± ∞ ¹    14.00 ± ∞ ¹       ~ (p=1.000 n=1) ³         -22.22% 🚀
CachedKeyMatchModel                                 4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelWithDeny                             4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedPriorityModel                                 4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedWithEnforceContext                            4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelMediumParallel                       4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
HasPolicySmall                                      4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
HasPolicyMedium                                     4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
HasPolicyLarge                                      5.000 ± ∞ ¹    5.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
AddPolicySmall                                      6.000 ± ∞ ¹    6.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
AddPolicyMedium                                     7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
AddPolicyLarge                                      9.000 ± ∞ ¹    9.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RemovePolicySmall                                   7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RemovePolicyMedium                                  7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RemovePolicyLarge                                   8.000 ± ∞ ¹    8.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
Raw                                                 0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
BasicModel                                          18.00 ± ∞ ¹    14.00 ± ∞ ¹       ~ (p=1.000 n=1) ³         -22.22% 🚀
RBACModel                                           36.00 ± ∞ ¹    32.00 ± ∞ ¹       ~ (p=1.000 n=1) ³         -11.11% 🚀
RBACModelSizes/small                                481.0 ± ∞ ¹    477.0 ± ∞ ¹       ~ (p=1.000 n=1) ³         -0.83% ➡️
RBACModelSizes/medium                              4.829k ± ∞ ¹   4.825k ± ∞ ¹       ~ (p=1.000 n=1) ³         -0.08% ➡️
RBACModelSizes/large                               48.15k ± ∞ ¹   48.20k ± ∞ ¹       ~ (p=1.000 n=1) ³         +0.10% ➡️
RBACModelSmall                                      616.0 ± ∞ ¹    612.0 ± ∞ ¹       ~ (p=1.000 n=1) ³         -0.65% ➡️
RBACModelMedium                                    6.016k ± ∞ ¹   6.012k ± ∞ ¹       ~ (p=1.000 n=1) ³         -0.07% ➡️
RBACModelLarge                                     60.08k ± ∞ ¹   60.08k ± ∞ ¹       ~ (p=1.000 n=1) ³         +0.00% ➡️
RBACModelWithResourceRoles                          28.00 ± ∞ ¹    24.00 ± ∞ ¹       ~ (p=1.000 n=1) ³         -14.29% 🚀
RBACModelWithDomains                                26.00 ± ∞ ¹    22.00 ± ∞ ¹       ~ (p=1.000 n=1) ³         -15.38% 🚀
ABACModel                                           17.00 ± ∞ ¹    13.00 ± ∞ ¹       ~ (p=1.000 n=1) ³         -23.53% 🚀
ABACRuleModel                                      37.09k ± ∞ ¹   37.08k ± ∞ ¹       ~ (p=1.000 n=1) ³         -0.03% ➡️
KeyMatchModel                                       38.00 ± ∞ ¹    34.00 ± ∞ ¹       ~ (p=1.000 n=1) ³         -10.53% 🚀
RBACModelWithDeny                                   50.00 ± ∞ ¹    46.00 ± ∞ ¹       ~ (p=1.000 n=1) ³         -8.00% ➡️
PriorityModel                                       23.00 ± ∞ ¹    19.00 ± ∞ ¹       ~ (p=1.000 n=1) ³         -17.39% 🚀
RBACModelWithDomainPatternLarge                     73.00 ± ∞ ¹    69.00 ± ∞ ¹       ~ (p=1.000 n=1) ³         -5.48% ➡️
RoleManagerSmall                                    100.0 ± ∞ ¹    100.0 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RoleManagerMedium                                  1.744k ± ∞ ¹   1.744k ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RoleManagerLarge                                   19.74k ± ∞ ¹   19.74k ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
BuildRoleLinksWithPatternLarge                     3.560M ± ∞ ¹   3.560M ± ∞ ¹       ~ (p=1.000 n=1) ³         +0.00% ➡️
BuildRoleLinksWithDomainPatternLarge               120.2k ± ∞ ¹   120.2k ± ∞ ¹       ~ (p=1.000 n=1) ³         +0.00% ➡️
BuildRoleLinksWithPatternAndDomainPatternLarge     3.637M ± ∞ ¹   3.637M ± ∞ ¹       ~ (p=1.000 n=1) ³         +0.00% ➡️
HasLinkWithPatternLarge                             9.000 ± ∞ ¹    9.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
HasLinkWithDomainPatternLarge                       1.000 ± ∞ ¹    1.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
HasLinkWithPatternAndDomainPatternLarge             9.000 ± ∞ ¹    9.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
ConcurrentHasLinkWithMatching                       11.00 ± ∞ ¹    11.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
geomean                                                         ⁴                                              -3.28% ➡️               ⁴
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ need >= 4 samples to detect a difference at alpha level 0.05
⁴ summaries must be >0 to compute geomean

🤖 This comment will be automatically updated with the latest benchmark results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant